<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var friendName = 'World';
    (function() {
        if (typeof friendName === 'undefined') { //? 这里面仍有变量提升 故这name不是全局name而是局部name
            var friendName = 'Jack';
            console.log('Goodbye ' + friendName);
        } else {
            console.log('Hello ' + friendName);
        }
    })();
</script>
</body>
</html>
